﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DIS.Infrastructure.Entities.Repository;
using DIS.Infrastructure.Entities.Enum;
using DIS.Infrastructure.Entities.Cache;

namespace DIS.Infrastructure.Entities.Entity
{
    public class FinancialPeriod : IAccessible<T_FinancialPeriod, FinancialPeriod>, ILogicEntity<T_FinancialPeriod, FinancialPeriod>
    {
        public int Id { get; set; }
         
        public string Year { get; set; }
         
        public string Month { get; set; }
         
        public string StartDate { get; set; }
         
        public string EndDate { get; set; }

        public int Status { get; set; }

        protected override void Covariant(T_FinancialPeriod model)
        {
            this.Id = model.Id;
            this.Year = model.Year;
            this.Month = model.Month;
            this.StartDate = model.StartDate;
            this.EndDate = model.EndDate;
            this.Status = model.Status;

        }
        protected override T_FinancialPeriod Inverter(FinancialPeriod model)
        {
            return new T_FinancialPeriod()
            {
                Id = model.Id,
                Year = model.Year,
                Month = model.Month,
                StartDate = model.StartDate,
                EndDate = model.EndDate,
                Status = model.Status
            };
        }
        public FinancialPeriod Set(T_FinancialPeriod dbModel)
        {
            Covariant(dbModel);
            return this;
        }
    }
}
